package controllerMembros;

import java.io.IOException;
import java.util.List;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import model.membroModel;

import dao.membros;

/**
 * Servlet implementation class controllerMembrosVinculo
 */
@WebServlet("/controllerMembrosVinculo")
public class controllerMembrosVinculo extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public controllerMembrosVinculo() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		
	}

	

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
	}	
	
	
protected void service (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
	
	String vinculo = request.getParameter("vinculo");
	membroModel membroModel = new membroModel();
	
	System.out.println("vinculo"+ vinculo);
	
	
        List<membros> listaMembros = membroModel.getMembroListaVinculo(vinculo);
		request.setAttribute("listamembros", listaMembros);// no request coloca o objeto
												// para depois capturar o
									// valor na jsp
		
		RequestDispatcher rd = request
				.getRequestDispatcher("/Membros.jsp");
		rd.forward(request, response);	
	
	
	

	
	
	}	
	
}
